/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ipfw.cs590.cheat.struts.actionforms;

import java.util.List;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.web_cat._1_0.assignment_sharing.Assignment;

/**
 *
 * @author safar
 */
public class ViewAssignmentForm extends ActionForm {

    /**
     * Assignment.
     */
    private Assignment assignment;
    /**
     * Assignment History.
     */
    private List<Assignment> assignmentHistory;
    /**
     * is the requestor the owner.
     */
    private boolean isOwner;

    /**
     * @return the assignment
     */
    public Assignment getAssignment() {
        return assignment;
    }

    /**
     * @param assignment the assignment to set
     */
    public void setAssignment(Assignment assignment) {
        this.assignment = assignment;
    }

    /**
     * @return the assignmentHistory
     */
    public List<Assignment> getAssignmentHistory() {
        return assignmentHistory;
    }

    /**
     * @param assignmentHistory the assignmentHistory to set
     */
    public void setAssignmentHistory(List<Assignment> assignmentHistory) {
        this.assignmentHistory = assignmentHistory;
    }

    /**
     * @return the isOwner
     */
    public boolean isIsOwner() {
        return isOwner;
    }

    /**
     * @param isOwner the isOwner to set
     */
    public void setIsOwner(boolean isOwner) {
        this.isOwner = isOwner;
    }

    /**
     *
     */
    public ViewAssignmentForm() {
        super();
        assignmentHistory = null;
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        //if (getName() == null || getName().length() < 1) {
        //   errors.add("name", new ActionMessage("error.name.required"));
        //}
        return errors;
    }
}
